package com.sf.dlb.jpa.repository;

import com.sf.dlb.jpa.model.AppVersionInfo;
import com.sf.dlb.jpa.model.NewClassInfo;
import com.sf.dlb.jpa.model.UserInvitationInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户邀请表 Repository
 *
 * Created by jing.tan on 2018/5/21.
 */
@Repository
public interface UserInvitationRepository extends JpaRepository<UserInvitationInfo, Long> {

    /**
     * 根据邀请码查询邀请记录
     * @param qrCode
     * @param delflag
     * @return
     */
    List<UserInvitationInfo> findByQrCodeAndDelFlag(String qrCode, String delflag);
    /**
     * 根据用户查询邀请人记录
     * @param userId
     * @param delflag
     * @return
     */
    List<UserInvitationInfo> findByUserIdAndDelFlag(String userId, String delflag);
    /**
     * 根据被邀请者-查询邀请者
     * @param invitataionUserId
     * @param delflag
     * @return
     */
    UserInvitationInfo findByInvitationUserIdAndDelFlag(String invitataionUserId, String delflag);
}